home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / g_duke / mapprt.zip / MGR.H < prev    next >
C/C++ Source or Header  |  1996-05-27  |  3KB  |  104 lines

  1. /*
  2.  
  3.     MGR.H
  4.  
  5.    Oliver Kraus
  6.    kraus@lrs.e-technik.uni-erlangen.de
  7.  
  8. */
  9.  
  10. #ifndef _MGR_H
  11. #define _MGR_H
  12.  
  13. #include "bmf.h"
  14.  
  15. #define MGR_PREC 16
  16.  
  17. struct _mgr_struct
  18. {
  19.     long width;
  20.     long height;
  21.     long bytes_per_line;
  22.     long bitmap_size;
  23.     unsigned char *bitmap_ptr;
  24.     unsigned char *compressed_line;
  25.     long brush_width;
  26.     long brush_height;
  27.     long brush_xm;
  28.     long brush_ym;
  29.     long brush_bytes_per_line;
  30.     long brush_last_r;
  31.     unsigned char *brush_pat;
  32.     unsigned char *brush_ptr;
  33.  
  34.     bmf_type bmf;
  35.  
  36.     long x_char_offset;
  37. };
  38. typedef struct _mgr_struct mgr_struct;
  39. typedef struct _mgr_struct *mgr_type;
  40.  
  41.  
  42.  
  43. mgr_type mgr_Open(long width, long height);
  44. void mgr_Close(mgr_type mgr);
  45. int mgr_ClrMap(mgr_type mgr);
  46. int mgr_SetPixel(mgr_type mgr, long x, long y);
  47. int mgr_ClrPixel(mgr_type mgr, long x, long y);
  48. int mgr_SetLine(mgr_type mgr, long x1, long y1, long x2, long y2 );
  49. int mgr_SetString(mgr_type mgr, long x, long y, char *s);
  50. int mgr_SetCircle(mgr_type mgr, long xm, long ym, long r);
  51. int mgr_WritePCX(mgr_type mgr, char *name, unsigned dpi);
  52. int mgr_WriteLaserjet(mgr_type mgr, unsigned lpt, unsigned dpi, unsigned left);
  53. int mgr_WriteCompressedLaserjet(mgr_type mgr, unsigned lpt, unsigned dpi, unsigned left);
  54.  
  55. int mgr_OpenBrush(mgr_type mgr, long width, long height);
  56. int mgr_MakeEmptyBrush(mgr_type mgr);
  57. int mgr_MakeDiskBrush(mgr_type mgr, long r);
  58. int mgr_DrawBrush(mgr_type mgr, long x, long y);
  59. int mgr_SetLineBrush(mgr_type mgr, long x1, long y1, long x2, long y2 );
  60. #define mgr_SetBrushPat(mgr, pat) ((mgr)->brush_pat = (pat))
  61. int mgr_SetCircleBrush(mgr_type mgr, long xm, long ym, long r);
  62.  
  63. long mgr_GetFontHeight(mgr_type mgr);
  64. #define mgr_SetFont(mgr,fnt) ((mgr)->bmf = (fnt))
  65. long mgr_SetFontHeight(mgr_type mgr, long new_height);
  66. long mgr_GetStringWidth(mgr_type mgr, char *s);
  67.  
  68. #pragma pack(1)
  69.  
  70. struct _pcxhdr_struct
  71. {
  72.     unsigned char  nanufacturer;   /* 10 = ZSoft .pcx */
  73.     unsigned char  version;        /* 2 = Mono PCX */
  74.     unsigned char  encoding;       /* 1 = .PCX run length encoding */
  75.     unsigned char  bits_per_pixel;
  76.     unsigned short xmin;
  77.     unsigned short ymin;
  78.     unsigned short xmax;
  79.     unsigned short ymax;
  80.  
  81.     unsigned short hres;           /* dpi */
  82.     unsigned short vres;           /* dpi */
  83.  
  84.     unsigned char  rgb[16][3];
  85.     unsigned char  reserved;
  86.     unsigned char  nplanes;        /* Number of color planes (1) */
  87.     unsigned short bytes_per_line; /* No of bytes to allocate for a scanline */
  88.     unsigned short paltype;        /* 1 = Color/BW, 2 = Grayscale*/
  89.     unsigned short hsize;
  90.     unsigned short vsize;
  91.     unsigned char  filler[54];
  92. };
  93. typedef struct _pcxhdr_struct pcxhdr_struct;
  94.  
  95. #pragma pack()
  96.  
  97.  
  98. extern unsigned char brush_pat0[16];
  99. extern unsigned char brush_pat1[16];
  100. extern unsigned char brush_pat2[16];
  101. extern unsigned char brush_pat3[16];
  102.  
  103. #endif /* _MGR_H */
  104.